package org.oschina.util;

import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail;

public class EMailUtil {

	/**
	 * 发送邮件
	 * @param host
	 * @param from
	 * @param password
	 * @param target
	 * @param title
	 * @param content
	 * @throws EmailException
	 */
	public static void send(String host,String from,String password,String target,String title,String content) throws EmailException
	{
		//SimpleEmail
		HtmlEmail email=new HtmlEmail();
		email.setHostName(host);
		email.setAuthentication(from,password);
		email.setCharset("UTF-8");
		email.addTo(target);
		email.setFrom(from,password);
		email.setSubject(title);
		email.setHtmlMsg(content);
		email.send();
	}
}